package com.senlingspace.payment.lakala.bean.response;

import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * 拉卡拉聚合主扫订单返回结果
 * </br>
 * 样例：
 * {
 *   "code": "BBS00000",
 *   "msg": "成功",
 *   "resp_time": "20240927180918",
 *   "resp_data": {
 *     "merchant_no": "8221000581228XH",
 *     "out_trade_no": "1397661540090134",
 *     "trade_no": "20240927110113130266218073831545",
 *     "log_no": "66218073831545",
 *     "settle_merchant_no": "",
 *     "settle_term_no": "",
 *     "acc_resp_fields": {
 *       "code": "",
 *       "code_image": "",
 *       "prepay_id": "wx27180918747030bdb66ef653004cd90000",
 *       "app_id": "wx5237a774f0e757b6",
 *       "pay_sign": "xf6qPqYez4UiNLc1jGE9VBWHo7L95vdNeDJyteZlan6Z65TT0PY2k++GnbxXkd7TB9uKRchwM52lZYFB72pqT4Q4lFNiduUdEUU5pu6vc8qK2tpvGroKNu7VJMNEHto3JXaVmAODGeCfWA4gAgZpa+y/ejy+e3u2bSp9abz/X6SSuant1EfsMaxeM3Tt6FEYnx4lGhbmJzSRMrOgHkPRKpqka3KY3J/hSWbmeY4cgyhfnqKiwZf5rC9XNXbEwJhgHal8AgokA2F1mmjtG8yOshF094kfiPcDjoGmNRTHEkBcQ06sCwv4lqxk1BbGRkH7RHGeAIK5jNNVKCjTsipUcw==",
 *       "time_stamp": "1727431758",
 *       "nonce_str": "b2b9b81f7c874458a238678102762580",
 *       "package": "prepay_id=wx27180918747030bdb66ef653004cd90000",
 *       "sign_type": "RSA",
 *       "redirect_url": "",
 *       "best_pay_info": "",
 *       "partner_id": ""
 *     }
 *   }
 * }
 *
 * @author lebronjames
 * @date 2024/09/29
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class LakalaPreorderResponse extends LakalaCommonResponse {

    @JsonProperty("resp_data")
    private RespData respData;

    @Data
    public static class RespData implements Serializable {

        @JsonProperty("log_no")
        private String logNo;

        @JsonProperty("trade_no")
        private String tradeNo;

        @JsonProperty("out_trade_no")
        private String outTradeNo;

        @JsonProperty("merchant_no")
        private String merchantNo;

        @JsonProperty("settle_merchant_no")
        private String settleMerchantNo;

        @JsonProperty("settle_term_no")
        private String settleTermNo;

        /**
         * 微信(71-小程序)、微信(51-JSAPI)，场景下返回acc_resp_fields域
         * <p>
         * 字段名	    中文名称	        是否必填	    类型	            说明
         * prepay_id	预下单Id	        M	        String(32)	    预支付交易会话ID
         * pay_sign	    支付签名信息	    M	        String(256)	    签名
         * app_id	    小程序id	        M	        String(32)	    商户注册具有支付权限的小程序成功后即可获得小程序id
         * time_stamp	时间戳	        M	        String(32)	    当前的时间
         * nonce_str	随机字符串	    M	        String(32)	    随机字符串
         * package	    订单详情扩展字符串	M	        String(128)
         * sign_type	签名方式	        M	        String(32)	    签名类型，支持RSA
         */
        @JsonProperty("acc_resp_fields")
        private JSONObject accRespFields;
    }

}
